package com.yanduo.utils

import com.typesafe.config.ConfigFactory

/**
  *
  * @author Gerry chan
  * @version 1.0
  */
object Tools {

  lazy val load = ConfigFactory.load()

  /**
    * 字符串转整形
    * @param str
    * @return
    */
  def str2Int(str: String):Int = {
    try {
      str.toInt
    } catch {
      case _: Exception =>0
    }
  }

  /**
    * 字符串转double
    * @param str
    * @return
    */
  def str2Double(str:String):Double = {
    try {
      str.toDouble
    } catch {
      case _: Exception =>0
    }
  }


}
